package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.FamFamilyMapper;
import com.ruoyi.system.domain.FamFamily;
import com.ruoyi.system.service.IFamFamilyService;

/**
 * 家谱Service业务层处理
 * 
 * @author wk
 * @date 2022-05-07
 */
@Service
public class FamFamilyServiceImpl implements IFamFamilyService 
{
    @Autowired
    private FamFamilyMapper famFamilyMapper;

    /**
     * 查询家谱
     * 
     * @param id 家谱主键
     * @return 家谱
     */
    @Override
    public FamFamily selectFamFamilyById(Long id)
    {
        return famFamilyMapper.selectFamFamilyById(id);
    }

    /**
     * 查询家谱列表
     * 
     * @param famFamily 家谱
     * @return 家谱
     */
    @Override
    public List<FamFamily> selectFamFamilyList(FamFamily famFamily)
    {
        return famFamilyMapper.selectFamFamilyList(famFamily);
    }

    /**
     * 新增家谱
     * 
     * @param famFamily 家谱
     * @return 结果
     */
    @Override
    public int insertFamFamily(FamFamily famFamily)
    {
        famFamily.setCreateTime(DateUtils.getNowDate());
        return famFamilyMapper.insertFamFamily(famFamily);
    }

    /**
     * 修改家谱
     * 
     * @param famFamily 家谱
     * @return 结果
     */
    @Override
    public int updateFamFamily(FamFamily famFamily)
    {
        famFamily.setUpdateTime(DateUtils.getNowDate());
        return famFamilyMapper.updateFamFamily(famFamily);
    }

    /**
     * 批量删除家谱
     * 
     * @param ids 需要删除的家谱主键
     * @return 结果
     */
    @Override
    public int deleteFamFamilyByIds(Long[] ids)
    {
        return famFamilyMapper.deleteFamFamilyByIds(ids);
    }

    /**
     * 删除家谱信息
     * 
     * @param id 家谱主键
     * @return 结果
     */
    @Override
    public int deleteFamFamilyById(Long id)
    {
        return famFamilyMapper.deleteFamFamilyById(id);
    }
}
